#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
****************************************************
Project:python
Filename: fire.py
Author:银河
Create: 2025/1/20 上午11:05 
Notes:
cron: 0 10 15 * *
每个月15号上午10点
***************************************************
'''
import requests
import time

def run():

    data = {
        "title": "灭火器检查",
        "content": '请立即检查机房灭火器，并签字！！！'
    }
    res = requests.post(url="http://yh.xuenn.cn/api/email/", data=data)
    if res.status_code == 200:
        print('邮件发送成功')
        return '邮件发送成功'
    else:
        print('系统错误，邮件发送失败')
        return '系统错误，邮件发送失败'


if __name__ == '__main__':
    t1 = time.time()
    response = run()
    t2 = time.time()
    data = {
        "name": "灭火器检查",
        "content": str(response),
        "rtime": round(t2 - t1, 3),
        "isNormal":1
    }
    requests.post(url="http://yi.xuenn.cn/sys/add/run/logs/",data=data)
    print('新增成功')
